package com.ruoyi.oto.tagvisible;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.oto.domain.CompanyCore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CompanyTagVisible {
    /**
     * 企业会员IDS
     */
    private List<String> companyMemberIds;
    /**
     * 企业列表
     */
    private List<CompanyCore> companyCores;

    public CompanyTagVisible(List<String> companyMemberIds, List<CompanyCore> companyCores) {
        this.companyMemberIds = companyMemberIds;
        if(companyMemberIds!=null && !companyMemberIds.isEmpty()){
            for(CompanyCore companyCore : companyCores){
                if(companyMemberIds.contains(companyCore.getMemberId().toString())){
                    companyCore.setTagVisible(true);
                }
            }
        }
        this.companyCores = companyCores;
    }
}
